home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / GL / dmesa.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-16  |  4.6 KB  |  161 lines

  1. /*
  2.  * Mesa 3-D graphics library
  3.  * Version:  6.1
  4.  * 
  5.  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
  6.  * 
  7.  * Permission is hereby granted, free of charge, to any person obtaining a
  8.  * copy of this software and associated documentation files (the "Software"),
  9.  * to deal in the Software without restriction, including without limitation
  10.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11.  * and/or sell copies of the Software, and to permit persons to whom the
  12.  * Software is furnished to do so, subject to the following conditions:
  13.  * 
  14.  * The above copyright notice and this permission notice shall be included
  15.  * in all copies or substantial portions of the Software.
  16.  * 
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18.  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  20.  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  21.  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  22.  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  */
  24.  
  25. /*
  26.  * DOS/DJGPP device driver for Mesa
  27.  *
  28.  *  Author: Daniel Borca
  29.  *  Email : dborca@users.sourceforge.net
  30.  *  Web   : http://www.geocities.com/dborca
  31.  */
  32.  
  33.  
  34. #ifndef DMESA_H_included
  35. #define DMESA_H_included
  36.  
  37. #define DMESA_MAJOR_VERSION 6
  38. #define DMESA_MINOR_VERSION 5
  39.  
  40. /* Sample Usage:
  41.  *
  42.  * 1. Call DMesaCreateVisual() to initialize graphics.
  43.  * 2. Call DMesaCreateContext() to create a DMesa rendering context.
  44.  * 3. Call DMesaCreateBuffer() to define the window.
  45.  * 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
  46.  * 5. Make gl* calls to render your graphics.
  47.  * 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
  48.  * 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
  49.  */
  50.  
  51. typedef struct dmesa_context *DMesaContext;
  52. typedef struct dmesa_visual *DMesaVisual;
  53. typedef struct dmesa_buffer *DMesaBuffer;
  54.  
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58.  
  59. /*
  60.  * Create a new Visual and set graphics mode.
  61.  */
  62. DMesaVisual DMesaCreateVisual (GLint width,        /* X res */
  63.                                GLint height,       /* Y res */
  64.                                GLint colDepth,     /* BPP */
  65.                                GLint refresh,      /* refresh rate: 0=default */
  66.                                GLboolean dbFlag,   /* double-buffered */
  67.                                GLboolean rgbFlag,  /* RGB mode */
  68.                                GLint alphaSize,    /* requested bits/alpha */
  69.                                GLint depthSize,    /* requested bits/depth */
  70.                                GLint stencilSize,  /* requested bits/stencil */
  71.                                GLint accumSize);   /* requested bits/accum */
  72.  
  73. /*
  74.  * Destroy Visual and restore screen.
  75.  */
  76. void DMesaDestroyVisual (DMesaVisual v);
  77.  
  78.  
  79.  
  80. /*
  81.  * Create a new Context for rendering.
  82.  */
  83. DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
  84.  
  85. /*
  86.  * Destroy Context.
  87.  */
  88. void DMesaDestroyContext (DMesaContext c);
  89.  
  90. /*
  91.  * Return a handle to the current context.
  92.  */
  93. DMesaContext DMesaGetCurrentContext (void);
  94.  
  95.  
  96.  
  97. /*
  98.  * Create a new Buffer (window).
  99.  */
  100. DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
  101.                                GLint xpos, GLint ypos,
  102.                                GLint width, GLint height);
  103.  
  104. /*
  105.  * Destroy Buffer.
  106.  */
  107. void DMesaDestroyBuffer (DMesaBuffer b);
  108.  
  109. /*
  110.  * Return a handle to the current buffer.
  111.  */
  112. DMesaBuffer DMesaGetCurrentBuffer (void);
  113.  
  114. /*
  115.  * Swap the front and back buffers for the given Buffer.
  116.  * No action is taken if the buffer is not double buffered.
  117.  */
  118. void DMesaSwapBuffers (DMesaBuffer b);
  119.  
  120. /*
  121.  * Bind Buffer to Context and make the Context the current one.
  122.  */
  123. GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
  124.  
  125.  
  126.  
  127. /*
  128.  * Move/Resize current Buffer.
  129.  */
  130. GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
  131. GLboolean DMesaResizeBuffer (GLint width, GLint height);
  132.  
  133. /*
  134.  * Set palette index, using normalized values.
  135.  */
  136. void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
  137.  
  138. /*
  139.  * DMesa functions
  140.  */
  141. typedef void (*DMesaProc) ();
  142. DMesaProc DMesaGetProcAddress (const char *name);
  143.  
  144. /*
  145.  * DMesa state retrieval.
  146.  */
  147. #define DMESA_GET_SCREEN_SIZE 0x0100
  148. #define DMESA_GET_DRIVER_CAPS 0x0200
  149. #define DMESA_GET_VIDEO_MODES 0x0300
  150. #define DMESA_GET_BUFFER_ADDR 0x0400
  151.  
  152. #define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
  153. #define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
  154. int DMesaGetIntegerv (GLenum pname, GLint *params);
  155.  
  156. #ifdef __cplusplus
  157. }
  158. #endif
  159.  
  160. #endif
  161.